import Vue from 'vue'
import Vuex from 'vuex'
import category from './modules/category'
import newList from './modules/newList'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
  },
  mutations: {
  },
  actions: {
  },
  // 通过根index建立getters，快捷访问
  getters: {
    category: state => state.category.category,
    currentCategory: state => state.category.currentCategory,
    currentList: state => state.newList.allData[state.category.currentCategory] || []
  },
  modules: {
    category,
    newList
  }
})
